local ma__tuyong = fk.CreateSkill {
  name = "ma__tuyong",
}

Fk:loadTranslationTable{
  ["ma__tuyong"] = "徒勇",
  [":ma__tuyong"] = "每回合限一次，你可以将所有手牌当【杀】使用或打出，本回合你下一次造成伤害后将手牌摸至体力上限（至多摸至五张）。",
  ["@ma__tuyong-turn"] = "徒勇",
  ["#ma__tuyong"] = "徒勇：你可以将所有手牌当【杀】使用或打出",
}

ma__tuyong:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#ma__tuyong",
  handly_pile = true,
  card_filter = Util.FalseFunc,
  view_as = function(self, player, cards)
    local card = Fk:cloneCard("slash")
    card:addSubcards(player:getCardIds("h"))
    card.skillName = ma__tuyong.name
    return card
  end,
  before_use = function(self, player, use)
  player.room:setPlayerMark(player, "@ma__tuyong-turn", 1)
  end,
  enabled_at_play = function(self, player)
    return not player:isKongcheng() and player:usedSkillTimes(ma__tuyong.name, Player.HistoryTurn) == 0
  end,
  enabled_at_response = function(self, player, response)
    return not player:isKongcheng() and player:usedSkillTimes(ma__tuyong.name, Player.HistoryTurn) == 0
  end,
})

ma__tuyong:addEffect(fk.Damage, {
  anim_type = "drawcard",
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and  player:getHandcardNum() < math.min(player.maxHp,5) and
      player:getMark("@ma__tuyong-turn") ~= 0
  end, 
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(math.min(player.maxHp,5) - player:getHandcardNum(), ma__tuyong.name)
    room:setPlayerMark(player, "@ma__tuyong-turn", 0)
  end,
})

return ma__tuyong
